Oracle SQLs: Get system date; count user tables. etc,.

Categories: Database; Tagged with: ; @ October 22nd, 2011 19:32

Get system date

select to_char(sysdate, 'yyyy-mm-dd hh24:mi:ss') from dual; -- Get the formatted system date.
select sysdate from dual; -- Get date

Count user tables:

SELECT OWNER,COUNT(*) FROM ALL_TABLES GROUP BY OWNER;  -- List all user and table number they own;

select count(*) from dba_tables t where t.owner='NAME'; -- Count tables of user with the name of "NAME"
select count(table_name) from user_tables; -- Count tables of current user;

 

<->



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.